package com.xy.tool.data.redis.core;

import java.util.Objects;

public class Namespace extends Key {

    protected String name;
    protected String domain;

    public Namespace(String name, String domain) {
        Objects.requireNonNull(name, "The name is required.");
        Objects.requireNonNull(domain, "The domain is required.");
        this.name = name;
        this.domain = domain;
    }

    @Override
    public String toString() {
        return Key.concat(getSeparator(), name, domain);
    }

    public String getName() {
        return name;
    }

    public String getDomain() {
        return domain;
    }

}
